|
|
 |
|
|
|
|
ByVal x2 As Single, ByVal y2 As Single, _
hi() As Integer, lo() As Integer)
Dim tmp As Single
Dim ix As Integer
Dim iy As Integer
Dim Y As Single
Dim dy As Single
Dim firstx As Integer
Dim firsty As Integer
Dim skipping As Boolean
Dim above As Boolean
' Deal only with integers. x1 = CInt(x1)
y1 = CInt(y1)
x2 = CInt(x2)
y2 = CInt(y2)
' Make x1 < x2. If x2 < x1 Then
tmp = x1
x1 = x2
x2 = tmp
tmp = y1
y1 = y2
y2 = tmp
End If
' Deal with vertical lines separately. If x1 = x2 Then ' Make y1 < y2. If y2 < y1 Then
tmp = y1
y1 = y2
y2 = tmp
End If
If y1 <= lo(x1) Then
If y2 <= lo(x1) Then
pic.Line (x1, y1)-(x2, y2)
Else
pic.Line (x1, y1)-(x2, lo(x2))
End If
lo(x1) = y1
End If
If y2 >= hi(x2) Then
If y1 >= hi(x2) Then
pic.Line (x1, y1)-(x2, y2)
Else
pic.Line (x1, hi(x1))-(x2, y2)
End If
hi(x2) = y2 |
|
|
|
|
|